//
//  ViewController.m
//  TZImagePickerControllerLimitePhotoSize
//
//  Created by bj_szd on 2024/11/4.
//

#import "ViewController.h"
#import "TZImagePickerController/TZImagePickerController.h"

@interface ViewController ()<TZImagePickerControllerDelegate>

@property (nonatomic, strong) UIButton *pickerView;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    NSString *bytes = [NSString stringWithFormat:@"%dB",100];
    NSLog(@"bytes = %@",bytes);
    
    _pickerView = [UIButton buttonWithType:UIButtonTypeCustom];
    [self.view addSubview:_pickerView];
    _pickerView.frame = CGRectMake((CGRectGetWidth([UIScreen mainScreen].bounds) - 100) / 2, (CGRectGetHeight([UIScreen mainScreen].bounds) - 60) / 2, 100, 60);
    [_pickerView setTitleColor:UIColor.blackColor forState:UIControlStateNormal];
    _pickerView.titleLabel.font = [UIFont systemFontOfSize:15];
    [_pickerView setTitle:@"选取图片" forState:UIControlStateNormal];
    [_pickerView addTarget:self action:@selector(pickerPhotoMethod) forControlEvents:UIControlEventTouchUpInside];
}

-(void)pickerPhotoMethod {
    TZImagePickerController *imagePickerVc = [[TZImagePickerController alloc] initWithMaxImagesCount:10 delegate:self];
    imagePickerVc.allowSelectPhotoMaxSize = 1.5 * 1024 * 1024;
    [self presentViewController:imagePickerVc animated:YES completion:nil];
}


@end
